package com.itheima.day04.myinnerclass.test4;

public class Test {
    public static void main(String[] args) {

        new Inner1() {
            @Override
            public void show1(){
                System.out.println("我爱你");
            }
        }.show1();

        // 向上转型
        Inner2 i2 = new Inner2() {
            @Override
            public void show2(){
                System.out.println("我恨你");
            }
            @Override
            public void show3(){
                System.out.println("好恨你，也许");
            }
        };
        i2.show2();
        i2.show3();

    }
}

interface Inner1 {
    void show1();
}
interface Inner2 {
    void show2();
    void show3();
}

